//
//  ViewController.m
//  didiAnimation
//
//  Created by iOS app dev on 17/2/21.
//  Copyright © 2017年 007qilv. All rights reserved.
//

#import "ViewController.h"

#define  APP_WIDTH   [UIScreen mainScreen].bounds.size.width
#define APP_HEIGHT    [UIScreen mainScreen].bounds.size.height
@interface ViewController ()






@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
   
    self.view.backgroundColor = [UIColor colorWithWhite:0.8 alpha:0.2];
    
    _progressView = [[CCProgressView alloc] initWithFrame:CGRectMake((APP_WIDTH - 240) / 2.0f, (APP_HEIGHT - 240) / 2.0f, 240, 240)];
    
    [_progressView setAnimationTime:60];
    _progressView.start = ^() {
        NSLog(@"开始");
    };
    _progressView.animing = ^ (NSTimeInterval currentTime) {
        NSLog(@"进行中");
    };
    __block id weakSelf = self;
    _progressView.stop = ^ () {
        NSLog(@"结束");
        [weakSelf dismiss];
    };
    [self.view addSubview:_progressView];
    
    [_progressView startAnimation];
}

-(void)dismiss
{

    [_progressView removeFromSuperview];

}

@end
